<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTypeoptionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('typeoption', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('parent_id')->comment('分类信息上级项目ID');
            $table->smallInteger('order')->comment('分类信息排序');
            $table->string('title')->comment('分类信息项目标题');
            $table->string('description')->comment('分类信息项目描述');
            $table->string('identifier')->unique()->comment('分类信息项目标识');
            $table->string('type')->comment('分类信息项目类型');
            $table->string('unit')->comment('分类信息项目单位');
            $table->string('rules')->comment('分类信息项目规则');
            $table->string('protect')->comment('分类信息项目是否是保护项目');
            $table->string('expiration')->comment('分类信息项目是否受有效期限制');
            $table->string('permprompt')->comment('分类信息项目权限提示');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('typeoption');
    }
}
